﻿/** 
  * Insertion of all the needed data for testing the ILogger contract in Zen4SyncModel. 
  */

CREATE PROCEDURE [Admin].[sp_z4s_insert_test_data_ILogger]
AS

INSERT INTO [Admin].[testSessionCategory]
           ([testSessionCategory_id]
           ,[testSessionCategory_name])
     VALUES
           ('1CEC441C-D2EF-4E10-AEEF-549B4D25704A'
           ,'testSessionCategoryName1')

INSERT INTO [Admin].[testSession]
           ([testSession_id]
           ,[testSession_name]
           ,[testSession_createdOn]
           ,[testSession_testSessionCategoryId]
           ,[testSession_testSessionStateId])
     VALUES
           ('2C3C988A-675C-42D1-ACC5-D111E04D1F88'
           ,'TestSessionName1'
           ,CAST('2010-04-01 17:19:23.62' AS datetime)
           ,'1CEC441C-D2EF-4E10-AEEF-549B4D25704A'
           ,'9f5e44e3-96ec-467d-a0c7-a7e94d3c8b88')

INSERT INTO [Admin].[testServer]
           ([testServer_Id]
           ,[testServer_name]
           ,[testServer_hostName]
           ,[testServer_wcfConfigSectionName]
           ,[testServer_loadSyncApplicationPath]
           ,[testServer_configFilesDirectory]
           ,[testServer_mefComponentRootDirectory])
     VALUES
           ('4C439FF8-EE20-46C8-959A-250170B231F6'
           ,'TestServerName_1'
           ,'TestServerHostName_1'
           ,'TestServerwcfConfigSectionName_1'
           ,'TestServerloadSyncApplicationPath_1'
           ,'TestServerconfigFilesDirectory_1'
           ,null)



/**************************************************************************/
INSERT INTO [Scenario].[testScenario]
           ([testScenario_id]
           ,[testScenario_name])
     VALUES
           ('F5062C6D-C6F2-4995-BFFB-37EC4B9AB442'
           ,'clientAcitvityScenarioName_1')

INSERT INTO [Admin].[clientSession]
           ([clientSession_id]
           ,[clientSession_name]
           ,[clientSession_testServerId]
           ,[clientSession_testSessionId]
           ,[clientSession_enableLog]
           ,[clientSession_scheduledStartDateTime]
           ,[clientSession_testScenarioId]
           ,[clientSession_readyToStart]
           ,[clientSession_readyToStartDateTime]
           ,[clientSession_readyToStartDateTimeOnServer]
           ,[clientSession_processId]
           ,[clientSession_startDateTime]
           ,[clientSession_startDateTimeOnServer]
           ,[clientSession_endDateTime]
           ,[clientSession_endDateTimeOnServer]
           ,[clientSession_error])
     VALUES
           ('87843D09-C873-45DA-8E0E-B66A30D719A6'
           ,'ClientSessionName_1'
           ,'4C439FF8-EE20-46C8-959A-250170B231F6'
           ,'2C3C988A-675C-42D1-ACC5-D111E04D1F88'
           ,'1'
           ,CAST('2011-04-01 17:19:23.62' AS datetime)
           ,'F5062C6D-C6F2-4995-BFFB-37EC4B9AB442'
           ,'0'
           ,null
           ,null
           ,null
           ,null
           ,null
           ,null
           ,null
           ,null)

/* Activity 1 : mefExecution */		
INSERT INTO [MEF].[mefComponent]
           ([mefComponent_id]
           ,[mefComponent_name])
     VALUES
           ('58BDC26C-F7D7-4640-8009-37D7800E43BA'
           ,'mefComponentName')

INSERT INTO [MEF].[mefComponentVersion]
           ([mefComponentVersion_id]
           ,[mefComponentVersion_mefComponentId]
           ,[mefComponentVersion_version]
           ,[mefComponentVersion_dll])
     VALUES
           ('546C06A4-B1D1-4C39-9676-A7C4BC7C6395'
           ,'58BDC26C-F7D7-4640-8009-37D7800E43BA'
           ,'version'
           ,CONVERT(varbinary(MAX), 'dll'))

INSERT INTO [MEF].[mefExecution]
           ([mefExecution_id]
           ,[mefExecution_mefComponentVersionId]
           ,[mefExecution_metadata])
     VALUES
           ('BD9BC3C9-D89C-47AB-9A19-5279B83DCC21'
           ,'546C06A4-B1D1-4C39-9676-A7C4BC7C6395'
           ,'metadata.xml')

INSERT INTO [MEF].[mefExecutionContext]
           ([mefExecutionContext_id]
           ,[mefExecutionContext_name]
           ,[mefExecutionContext_metadata])
     VALUES
           ('6C4A0055-3F2D-4C2D-8440-99C331AA0547'
           ,'mefExecutionContextName'
           ,'metadata.xml')

INSERT INTO [Scenario].[activity]
        ([activity_id]
           ,[activity_testScenarioId]
           ,[activity_activityTypeId]
           ,[activity_activityItemId]
           ,[activity_executionOrder]
           ,[activity_preWaitingTimeInSeconds]
           ,[activity_postWaitingTimeInSeconds])
     VALUES
           ('B09D041B-67EF-4B1F-83E0-68C3BA4559C3'
           ,'F5062C6D-C6F2-4995-BFFB-37EC4B9AB442'
           ,'8281DF90-4EBA-4E20-9487-DF5034DE0C9C'
           ,'BD9BC3C9-D89C-47AB-9A19-5279B83DCC21'
           ,'1'
           ,'0'
           ,'0')

INSERT INTO [Scenario].[activityContext]
           ([activityContext_id]
           ,[activityContext_activityId]
           ,[activityContext_clientSessionId]
           ,[activityContext_contextItemId])
     VALUES
           ('B7D9D25D-A975-48C7-8A82-9387C068DA29'
           ,'B09D041B-67EF-4B1F-83E0-68C3BA4559C3'
           ,'87843D09-C873-45DA-8E0E-B66A30D719A6'
           ,'6C4A0055-3F2D-4C2D-8440-99C331AA0547')

/* Activity 2 : sqlCeExecution */
INSERT INTO [SQLCEExecution].[sqlceExecution]
           ([sqlceExecution_id]
           ,[sqlceExecution_name]
           ,[sqlceExecution_sqlQuery])
     VALUES
           ('DC6A43A9-F354-4C9B-AB48-64E57508B7B0'
           ,'sqlceExecutionName'
           ,'sqlceExecutionSqlQuery')

INSERT INTO [SQLCEExecution].[sqlceExecutionContext]
           ([sqlceExecutionContext_id]
           ,[sqlceExecutionContext_name]
           ,[sqlceExecutionContext_connectionString]
           ,[sqlceExecutionContext_isEncryptedConnectionString])
     VALUES
           ('F11420F0-FDF8-458F-AFB2-D836F03D1AC5'
           ,'sqlceExecutionContextName'
           ,convert(varbinary(MAX),'connectionString')
           ,'0')

INSERT INTO [SQLCEExecution].[sqlceExecutionParameter]
           ([sqlceExecutionParameter_id]
           ,[sqlceExecutionParameter_name]
           ,[sqlceExecutionParameter_value]
           ,[sqlceExecutionParameter_sqlValueTypeId]
           ,[sqlceExecutionParameter_sqlceExecutionContextId])
     VALUES
           ('4C2E775A-9F98-4AB7-B0B8-5ECA4DA33748'
           ,'sqlceExecutionParameterName'
           ,CONVERT(varbinary(MAX), 'sqlceExecutionParameterValue')
           ,'65a98742-b90b-4735-8349-7a3ab63e7f44'
           ,'F11420F0-FDF8-458F-AFB2-D836F03D1AC5')		   

INSERT INTO [Scenario].[activity]
        ([activity_id]
           ,[activity_testScenarioId]
           ,[activity_activityTypeId]
           ,[activity_activityItemId]
           ,[activity_executionOrder]
           ,[activity_preWaitingTimeInSeconds]
           ,[activity_postWaitingTimeInSeconds])
     VALUES
           ('1399B199-45DE-4DF3-8BC4-ED485E759631'
           ,'F5062C6D-C6F2-4995-BFFB-37EC4B9AB442'
           ,'A41A6035-AE9F-4397-84AC-1D396E6FC409'
           ,'DC6A43A9-F354-4C9B-AB48-64E57508B7B0'
           ,'2'
           ,'0'
           ,'0')

INSERT INTO [Scenario].[activityContext]
           ([activityContext_id]
           ,[activityContext_activityId]
           ,[activityContext_clientSessionId]
           ,[activityContext_contextItemId])
     VALUES
           ('5D744293-9F7E-4080-AE2D-1AF5148F49FA'
           ,'1399B199-45DE-4DF3-8BC4-ED485E759631'
           ,'87843D09-C873-45DA-8E0E-B66A30D719A6'
           ,'F11420F0-FDF8-458F-AFB2-D836F03D1AC5')

/* Activity 3 : sqlServerExecution */
INSERT INTO [SQLServerExecution].[sqlServerExecution]
           ([sqlServerExecution_id]
           ,[sqlServerExecution_name]
           ,[sqlServerExecution_sqlQuery])
     VALUES
           ('0855D770-F6B9-4799-B879-D1952D1137BF'
           ,'sqlServerExecutionName'
           ,'sqlServerExecutionSqlQuery')

INSERT INTO [SQLServerExecution].[sqlServerExecutionContext]
           ([sqlServerExecutionContext_id]
           ,[sqlServerExecutionContext_name]
           ,[sqlServerExecutionContext_connectionString]
           ,[sqlServerExecutionContext_isEncryptedConnectionString])
     VALUES
           ('6ADA4C66-31EA-45AF-A404-1AF76ECE4D01'
            ,'sqlServerExecutionContextName'
           ,convert(varbinary(MAX),'connectionString')
           ,'0')

INSERT INTO [SQLServerExecution].[sqlServerExecutionParameter]
           ([sqlServerExecutionParameter_id]
           ,[sqlServerExecutionParameter_name]
           ,[sqlServerExecutionParameter_value]
           ,[sqlServerExecutionParameter_sqlValueTypeId]
           ,[sqlServerExecutionParameter_sqlServerExecutionContextId])
     VALUES
           ('C2A0D0D7-95C4-4A67-A52E-6A9F08CA923D'
           ,'sqlServerExecutionParameterName'
           ,CONVERT(varbinary(MAX), 'sqlServerExecutionParameterValue')
           ,'65a98742-b90b-4735-8349-7a3ab63e7f44'
           ,'6ADA4C66-31EA-45AF-A404-1AF76ECE4D01')

INSERT INTO [Scenario].[activity]
        ([activity_id]
           ,[activity_testScenarioId]
           ,[activity_activityTypeId]
           ,[activity_activityItemId]
           ,[activity_executionOrder]
           ,[activity_preWaitingTimeInSeconds]
           ,[activity_postWaitingTimeInSeconds])
     VALUES
           ('973DF053-E2EB-411C-A934-CC3A21B33A03'
           ,'F5062C6D-C6F2-4995-BFFB-37EC4B9AB442'
           ,'3F912BC2-E647-46A1-9B1A-B76D06FED3EA'
           ,'0855D770-F6B9-4799-B879-D1952D1137BF'
           ,'3'
           ,'0'
           ,'0')

INSERT INTO [Scenario].[activityContext]
           ([activityContext_id]
           ,[activityContext_activityId]
           ,[activityContext_clientSessionId]
           ,[activityContext_contextItemId])
     VALUES
           ('F1F2E548-ABE2-4201-A4D3-67976AC58AA9'
           ,'973DF053-E2EB-411C-A934-CC3A21B33A03'
           ,'87843D09-C873-45DA-8E0E-B66A30D719A6'
           ,'6ADA4C66-31EA-45AF-A404-1AF76ECE4D01')

/* Activity 4 : sqlceBackup */
INSERT INTO [SQLCEBackup].[sqlceBackup]
           ([sqlceBackup_id])
     VALUES
           ('A362C978-2E53-4C70-88B7-E70A1FEFA57E')

INSERT INTO [SQLCEBackup].[sqlceBackupContext]
           ([sqlceBackupContext_id]
           ,[sqlceBackupContext_name]
           ,[sqlceBackupContext_sdfFileName]
           ,[sqlceBackupContext_sdfFileDirectory])
     VALUES
           ('36751AE0-DAD7-4086-A654-91A34DBA7494'
           ,'sqlceBackupContextName'
           ,'sdfFileName'
           ,'sdfFileDirectory')

INSERT INTO [Scenario].[activity]
        ([activity_id]
           ,[activity_testScenarioId]
           ,[activity_activityTypeId]
           ,[activity_activityItemId]
           ,[activity_executionOrder]
           ,[activity_preWaitingTimeInSeconds]
           ,[activity_postWaitingTimeInSeconds])
     VALUES
            ('B5528FBA-9D65-4331-83C1-0A541507A2D8'
           ,'F5062C6D-C6F2-4995-BFFB-37EC4B9AB442'
           ,'5B03C91F-81B0-4360-A483-5666F3B31E16'
           ,'A362C978-2E53-4C70-88B7-E70A1FEFA57E'
           ,'4'
           ,'0'
           ,'0')

INSERT INTO [Scenario].[activityContext]
           ([activityContext_id]
           ,[activityContext_activityId]
           ,[activityContext_clientSessionId]
           ,[activityContext_contextItemId])
     VALUES
           ('E1E31B0B-043F-4D91-8526-418D6F3C0A12'
           ,'B5528FBA-9D65-4331-83C1-0A541507A2D8'
           ,'87843D09-C873-45DA-8E0E-B66A30D719A6'
           ,'36751AE0-DAD7-4086-A654-91A34DBA7494')

/**************************************************************************/
INSERT INTO [Scenario].[testScenario]
           ([testScenario_id]
           ,[testScenario_name])
     VALUES
           ('A65775BB-45B6-4FA7-B83B-7D6018719AF2'
           ,'clientAcitvityScenarioName_2')

INSERT INTO [Admin].[clientSession]
           ([clientSession_id]
           ,[clientSession_name]
           ,[clientSession_testServerId]
           ,[clientSession_testSessionId]
           ,[clientSession_enableLog]
           ,[clientSession_scheduledStartDateTime]
           ,[clientSession_testScenarioId]
           ,[clientSession_readyToStart]
           ,[clientSession_readyToStartDateTime]
           ,[clientSession_readyToStartDateTimeOnServer]
           ,[clientSession_processId]
           ,[clientSession_startDateTime]
           ,[clientSession_startDateTimeOnServer]
           ,[clientSession_endDateTime]
           ,[clientSession_endDateTimeOnServer]
           ,[clientSession_error])
     VALUES
           ('468CF8B1-4B26-4BF7-B9B1-DA57249F9281'
           ,'ClientSessionName_2'
           ,'4C439FF8-EE20-46C8-959A-250170B231F6'
           ,'2C3C988A-675C-42D1-ACC5-D111E04D1F88'
           ,'1'
           ,CAST('2011-04-01 17:19:23.62' AS datetime)
           ,'A65775BB-45B6-4FA7-B83B-7D6018719AF2'
           ,'0'
           ,null
           ,null
           ,null
           ,null
           ,null
           ,null
           ,null
           ,null)

INSERT INTO [SQLCEBackup].[sqlceBackup]
           ([sqlceBackup_id])
     VALUES
           ('7130DD19-4A05-48D7-B12B-8CDD29729719')

INSERT INTO [SQLCEBackup].[sqlceBackupContext]
           ([sqlceBackupContext_id]
           ,[sqlceBackupContext_name]
           ,[sqlceBackupContext_sdfFileName]
           ,[sqlceBackupContext_sdfFileDirectory])
     VALUES
           ('2FC74C5C-FCBA-49FE-A081-9933A0156E32'
           ,'sqlceBackupContextName'
           ,'sqlceBackupContext_sdfFileName'
           ,'sqlceBackupContext_sdfFileDirectory')

INSERT INTO [Scenario].[activity]
        ([activity_id]
           ,[activity_testScenarioId]
           ,[activity_activityTypeId]
           ,[activity_activityItemId]
           ,[activity_executionOrder]
           ,[activity_preWaitingTimeInSeconds]
           ,[activity_postWaitingTimeInSeconds])
     VALUES
           ('1D0C410E-0862-42C1-975E-650A214716DC'
           ,'A65775BB-45B6-4FA7-B83B-7D6018719AF2'
           ,'5B03C91F-81B0-4360-A483-5666F3B31E16'
           ,'7130DD19-4A05-48D7-B12B-8CDD29729719'
           ,'1'
           ,'0'
           ,'0')

INSERT INTO [Scenario].[activityContext]
           ([activityContext_id]
           ,[activityContext_activityId]
           ,[activityContext_clientSessionId]
           ,[activityContext_contextItemId])
     VALUES
           ('A624B7AB-6CE9-49E2-BBAD-77C39EE8A6AA'
           ,'1D0C410E-0862-42C1-975E-650A214716DC'
           ,'468CF8B1-4B26-4BF7-B9B1-DA57249F9281'
           ,'2FC74C5C-FCBA-49FE-A081-9933A0156E32')



/**************************************************************************/
INSERT INTO [Scenario].[testScenario]
           ([testScenario_id]
           ,[testScenario_name])
     VALUES
           ('6ACD74D0-2A4D-47A4-A2ED-87215E62378B'
           ,'clientAcitvityScenarioName_3')

INSERT INTO [Admin].[clientSession]
           ([clientSession_id]
           ,[clientSession_name]
           ,[clientSession_testServerId]
           ,[clientSession_testSessionId]
           ,[clientSession_enableLog]
           ,[clientSession_scheduledStartDateTime]
           ,[clientSession_testScenarioId]
           ,[clientSession_readyToStart]
           ,[clientSession_readyToStartDateTime]
           ,[clientSession_readyToStartDateTimeOnServer]
           ,[clientSession_processId]
           ,[clientSession_startDateTime]
           ,[clientSession_startDateTimeOnServer]
           ,[clientSession_endDateTime]
           ,[clientSession_endDateTimeOnServer]
           ,[clientSession_error])
     VALUES
           ('A8972390-1FD0-4708-ADA7-98B896EB55CC'
           ,'ClientSessionName_3'
           ,'4C439FF8-EE20-46C8-959A-250170B231F6'
           ,'2C3C988A-675C-42D1-ACC5-D111E04D1F88'
           ,'1'
           ,CAST('2011-04-01 17:19:23.62' AS datetime)
           ,'6ACD74D0-2A4D-47A4-A2ED-87215E62378B'
           ,'0'
           ,null
           ,null
           ,null
           ,null
           ,null
           ,null
           ,null
           ,null)

INSERT INTO [SQLCEBackup].[sqlceBackup]
           ([sqlceBackup_id])
     VALUES
           ('78E2DD04-34D7-483F-BB66-8E2D1A2E0660')

INSERT INTO [SQLCEBackup].[sqlceBackupContext]
           ([sqlceBackupContext_id]
           ,[sqlceBackupContext_name]
           ,[sqlceBackupContext_sdfFileName]
           ,[sqlceBackupContext_sdfFileDirectory])
     VALUES
           ('32D70110-F4C3-4535-9B14-7FA42D161313'
           ,'sqlceBackupContextName'
           ,'sqlceBackupContext_sdfFileName'
           ,'sqlceBackupContext_sdfFileDirectory')

INSERT INTO [Scenario].[activity]
        ([activity_id]
           ,[activity_testScenarioId]
           ,[activity_activityTypeId]
           ,[activity_activityItemId]
           ,[activity_executionOrder]
           ,[activity_preWaitingTimeInSeconds]
           ,[activity_postWaitingTimeInSeconds])
     VALUES
           ('A2C5A376-B45F-43E0-AFC8-727C654EA265'
           ,'A65775BB-45B6-4FA7-B83B-7D6018719AF2'
           ,'5B03C91F-81B0-4360-A483-5666F3B31E16'
           ,'78E2DD04-34D7-483F-BB66-8E2D1A2E0660'
           ,'1'
           ,'0'
           ,'0')

INSERT INTO [Scenario].[activityContext]
           ([activityContext_id]
           ,[activityContext_activityId]
           ,[activityContext_clientSessionId]
           ,[activityContext_contextItemId])
     VALUES
           ('35B1979A-2ED8-4160-852C-50F848D33F66'
           ,'A2C5A376-B45F-43E0-AFC8-727C654EA265'
           ,'A8972390-1FD0-4708-ADA7-98B896EB55CC'
           ,'32D70110-F4C3-4535-9B14-7FA42D161313')